import { axios } from '@/utils/request'

/**
 * 编辑或新增资源
 * @param parameter
 * @returns {AxiosPromise}
 */
export function saveOrUpdateResource(parameter) {
  return axios({
    url: '/resource/save_or_update',
    method: 'post',
    data: parameter
  })
}

/**
 * 根据ID删除资源
 * @param resourceIds
 * @returns {AxiosPromise}
 */
export function deleteByIds(resourceIds) {
  return axios({
    url: `/resource/delete/${ resourceIds }`,
    method: 'delete'
  })
}

/**
 * 获取资源树
 *
 * @returns {AxiosPromise}
 */
export function loadResourceTree() {
  return axios({
    url: 'resource/list/select',
    method: 'get'
  })
}
